#include <57header.h>

int main(int argc,char*argv[])
{

    int pipe_read = open("1.pipe", O_RDONLY);
    int pipe_write = open("2.pipe", O_WRONLY);

    // 读管道
    char buf[60] = {0};
    read(pipe_read, buf, sizeof(buf));

    // 打印
    printf("A: %s \n", buf);

    // 读取标准输入
    bzero(buf, sizeof(buf));
    read(STDIN_FILENO, buf, sizeof(buf));

    // 写管道
    write(pipe_write, buf, sizeof(buf));


    close(pipe_read);
    close(pipe_write);

    return 0;
}

